<template>
    <div>
        <div class="banner" @click="handleShowGallery">
            <img class="banner-img" 
            src="https://mp-piao-admincp.qunarzz.com/mp_piao_admin_mp_piao_admin/admin/202011/154522dfa17ea3adfca136436e500f0e.jpg_890x330_c88ca8ef.jpg"
            />
            <div class="banner-info">
                <div class="banner-title">海昌11.11</div>
                <div class="banner-number">
                    <span class="iconfont arrow-icon">&#xe69f;</span>36
                </div>
            </div>
        </div>
        <gallery :imgs="imgs" v-show="showGallery" @close="closeGallery"></gallery>
    </div>
</template>

<script>
import Gallery from 'common/gallery/Gallery'
export default {
  components: { Gallery },
     name: "DetailBanner",
     components: {
        Gallery
     },
     data () {
         return {
             imgs: ['https://i.loli.net/2020/11/18/YjlruH7Ea3k2gTA.jpg','https://i.loli.net/2020/11/18/YjlruH7Ea3k2gTA.jpg'],
             showGallery: false
         }
     },
     methods: {
         handleShowGallery () {
             this.showGallery = true
         },
         closeGallery () {
             this.showGallery = false
         }
     }

}
</script>

<style lang="stylus" scoped>
    .banner
        position: relative
        overflow: hidden
        width: 100%
        height: 0
        padding-bottom: 37%
        .banner-img
            width: 100%
        .banner-info
            position: absolute 
            display: flex
            bottom: 0
            left: 0
            right: 0
            line-height: .6rem
            font-size: .23rem
            color: #333
            padding: 0 .2rem
            color: #fff
            // 图片下方实现渐变样式
            background-image: linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
            .banner-title
                flex: 1
                margin-left: .5rem
            .banner-number
                margin-right: .7rem

</style>